<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<%@ page isELIgnored="false"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>山西煤炭现货公路交易系统客户端</title>
 <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.5 -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/bootstrap/css/bootstrap.min.css">
     <!-- daterange picker -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/plugins/daterangepicker/daterangepicker-bs3.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/font-awesome/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/ionicons/css/ionicons.min.css">
    <!-- jvectormap -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/plugins/jvectormap/jquery-jvectormap-1.2.2.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/dist/css/AdminLTE.min.css">
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/dist/css/skins/_all-skins.min.css">
     <!-- DataTables -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/plugins/datatables/dataTables.bootstrap.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/dist/css/skins/_all-skins.min.css">
	<!-- jQuery 2.1.4 -->
    <script src="<s:url value="/resources"/>/adminlte/plugins/jQuery/jQuery-2.1.4.min.js"></script>
	<!-- Bootstrap 3.3.5 -->
    <script src="<s:url value="/resources"/>/adminlte/bootstrap/js/bootstrap.min.js"></script>
	 <!-- AdminLTE App -->
    <script src="<s:url value="/resources"/>/adminlte/dist/js/app.min.js"></script>
    <!-- Select2 -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/plugins/select2/select2.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/dist/css/AdminLTE.min.css">
    <!-- date-range-picker -->
    <script src="<s:url value="/resources"/>/adminlte/moment.min.js"></script>
    <script src="<s:url value="/resources"/>/adminlte/plugins/daterangepicker/daterangepicker.js"></script>
    <!-- DataTables -->
    <script src="<s:url value="/resources"/>/adminlte/plugins/datatables/jquery.dataTables.min.js"></script>
    <script src="<s:url value="/resources"/>/adminlte/plugins/datatables/dataTables.bootstrap.min.js"></script>
     <!-- Select2 -->
    <script src="<s:url value="/resources"/>/adminlte/plugins/select2/select2.full.min.js"></script>
    <script src="<s:url value="/resources"/>/adminlte/plugins/select2/i18n/zh-CN.js"></script>
    <!-- 引入 echarts.js -->
    <script src="<s:url value="/resources"/>/echarts/echarts.min.js"></script>
     <script src="<s:url value="/resources"/>/adminlte/default.js"></script>
     <script src="<s:url value="/resources"/>/echarts/myechart/areaChart.js"></script>
      <script src="<s:url value="/resources"/>/adminlte/default_settlement.js"></script>
      <script src="<s:url value="/resources"/>/adminlte/plugins/jQueryUI/jquery-ui.js"></script>
      <script src="<s:url value="/resources"/>/adminlte/My97DatePicker/WdatePicker.js"></script>
      
     <script type="text/javascript">
 $(function(){  
   // loadUserInfo();
                     
    dataTab("dataTab",true,false,false,true,true,false,"<s:url value="/resources"/>/adminlte/dataTabBootstrapCN.json");
     
    loadMenu("${user.roleType}","${menuid}",${menuList});
      getSelOptsForSettle1("<s:url value="/"/>/settlement/getOptionByHavingSelected","selOdwdms","selIdwdms","odwdms","idwdms","tsCheck_jiaoys");
      //getSelOptsForSettle1("<s:url value="/"/>/settlement/getOptionByHavingSelected","selIdwdms","idwdms","tsCheck_jiaoys");
      
      getSelOptsForSettle("<s:url value="/"/>/settlement/getOptionByHavingSelected","selOshenfs","oshenfs","tsCheck_shenfs");
      getSelOptsForSettle("<s:url value="/"/>/settlement/getOptionByHavingSelected","selIshenfs","ishenfs","tsCheck_shenfs");
      
      getSelOptsForSettle("<s:url value="/"/>/settlement/getOptionByHavingSelected","selOhangys","ohangys","tsCheck_hangys");
      getSelOptsForSettle("<s:url value="/"/>/settlement/getOptionByHavingSelected","selIhangys","ihangys","tsCheck_hangys");
      
      $(".select2").select2();
      
      
 });
 function clickSum(){
	 if(validateDay("2")){
		 document.getElementById("form").submit();
	 }
 }
 function validatePage(){
 	if($("#reservation")[0].value==''){
 		alert("对不起，请选择查询年月");
 		return false;
 	}
 	if($("#odwdms")[0].selectedIndex==0
 		&&$("#idwdms")[0].selectedIndex==0
 		&&$("#oshenfs")[0].selectedIndex==-1
 		&&$("#ohangys")[0].selectedIndex==-1
 		&&$("#ishenfs")[0].selectedIndex==-1
 		&&$("#ihangys")[0].selectedIndex==-1){
 		alert("对不起，请选择至少一项除时间外的查询条件");
 		return false;
 	};
 	/* if($("#odwdms").val()==''
 		&&$("#idwdms").val()==''
 		&&$("#oshenfs")[0].selectedIndex==-1
 		&&$("#ohangys")[0].selectedIndex==-1
 		&&$("#ishenfs")[0].selectedIndex==-1
 		&&$("#ihangys")[0].selectedIndex==-1){
 		alert("对不起，请选择至少一项除时间外的查询条件");
 		return false;
 	};
 	 */
 	
 	form1.submit();
 }
     </script>
</head>
<body class="skin-blue sidebar-mini">
<div class="wrapper">
<%@ include file="../../header.jsp" %>
<%@ include file="../../sidebar.jsp" %>
<div class="content-wrapper" >
<!-- <iframe src="mtzq_html/classify1.html" name="main" class="iframe" frameborder="0" id="main" width="100%"  scrolling=no></iframe> -->
        <!-- Content Header (Page header) -->
        <div class="content-header">
          <h1>结算分析<small>交易商结算查询 </small></h1>
          <ol class="breadcrumb">
            <li><a href="<s:url value="/"/>/index.jsp"><i class="fa fa-dashboard"></i>首页</a></li>
            <li><a href="#" id="location1"></a></li>
            <li class="active" id="location2"></li>
          </ol>
        </div>

        <!-- Main content -->
        <div class="content">
         <!-- 查询条件 -->
         <form action="<s:url value="/"/>/settlement/tradeSettleCheck" method="post" id="form">
         <input type="hidden" value="${type}" name="type"/>
         <input type="hidden" value='${selOdwdms}' name="selOdwdms" id ="selOdwdms"/>
         <input type="hidden" value='${selIdwdms}' name="selIdwdms" id ="selIdwdms"/>
         <input type="hidden" value='${selOshenfs}' name="selOshenfs" id ="selOshenfs"/>
         <input type="hidden" value='${selIshenfs}' name="selIshenfs" id ="selIshenfs"/>
         <input type="hidden" value='${selIhangys}' name="selIhangys" id ="selIhangys"/>
         <input type="hidden" value='${selOhangys}' name="selOhangys" id ="selOhangys"/>
          <div class="box box-success">
            <div class="box-header with-border">
              <h3 class="box-title">查询条件</h3>
              <div class="box-tools pull-right">
                <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                <!-- <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-remove"></i></button> -->
              </div>
            </div><!-- /.box-header -->
            <div class="box-body">
              <div class="row">
              	<div class="col-md-6">
                 <!-- Date range -->
                 <div class="form-group">
                    <label>日期范围:</label>
                    <div class="input-group">
                    <div class="input-group-addon">
                        <i class="fa fa-calendar"></i>
                      </div>
                      <input type="text" style="width:30%;padding-left: 17px;height: 32px;border: 1px solid #d2d6de;"  class="" id="startDate" name="startDate" value="${startDate}" onfocus="WdatePicker({dateFmt:'yyyy-MM'})">
                      &nbsp;&nbsp;--&nbsp;&nbsp;<input type="text" style="width:30%;;padding-left: 27px;height: 32px;border: 1px solid #d2d6de;" class="" id="endDate" name="endDate" value="${endDate}" onfocus="WdatePicker({dateFmt:'yyyy-MM'})">
                    &nbsp;&nbsp;&nbsp;
                    </div><!-- /.input group -->
                 </div>
               </div>
               <div class="col-md-6">
                  <div class="form-group">
                  <label>&nbsp;</label>
                  	<div class="input-group">
                      <button class="btn btn-primary"  type="button" onclick="clickSum()">查询</button>
                     </div>
                  </div>
               </div>
              </div>
              <div class="row">
              	<div class="col-md-6">
                  <div class="form-group">
                    <label>买受人结算单位</label>
                   <%--  <input type="text" class="form-control pull-right" id="odwdms" name="odwdms"  value="${oldOdw}"> --%>
                    <select class="form-control select2" style="width: 100%;"  id="odwdms" name="odwdms"  data-placeholder="请选择买受人结算单位" >
                    </select>
                  </div><!-- /.form-group -->
                </div><!-- /.col -->
                
                <div class="col-md-6">
                  <div class="form-group">
                    <label>出卖人结算单位</label>
                    <%-- <input type="text" class="form-control pull-right" id="idwdms" name="idwdms"  value="${oldIdw}"/> --%>
                    <select id="idwdms" name="idwdms" class="form-control select2" data-placeholder="请选择出卖人结算单位" style="width: 100%;">
                    </select>
                  </div><!-- /.form-group -->
                </div><!-- /.col -->
              </div><!-- /.row -->
              
              <div class="row">
              	<div class="col-md-6">
                  <div class="form-group">
                    <label>买受人结算单位所属地区</label>
                    <select id="oshenfs" name="oshenfs" class="form-control select2" multiple="multiple" data-placeholder="请选择买受人结算单位所属地区" style="width: 100%;">
                    </select>
                  </div><!-- /.form-group -->
                </div><!-- /.col -->
                
                <div class="col-md-6">
                  <div class="form-group">
                    <label>买受人结算单位所属行业</label>
                    <select id="ohangys" name="ohangys" class="form-control select2" multiple="multiple" data-placeholder="请选择买受人结算单位所属行业" style="width: 100%;">
                    </select>
                  </div><!-- /.form-group -->
                </div><!-- /.col -->
              </div><!-- /.row -->
              
              <div class="row">
              	<div class="col-md-6">
                  <div class="form-group">
                    <label>出卖人结算单位所属地区</label>
                    <select id="ishenfs" name="ishenfs" class="form-control select2" multiple="multiple" data-placeholder="请选择出卖人结算单位所属地区" style="width: 100%;">
                    </select>
                  </div><!-- /.form-group -->
                </div><!-- /.col -->
                
                <div class="col-md-6">
                  <div class="form-group">
                    <label>出卖人结算单位所属行业</label>
                    <select id="ihangys" name="ihangys" class="form-control select2" multiple="multiple" data-placeholder="请选择出卖人结算单位所属行业" style="width: 100%;">
                    </select>
                  </div><!-- /.form-group -->
                </div><!-- /.col -->
              </div><!-- /.row -->
            </div><!-- /.box-body -->
            
          </div><!-- /.box -->
          </form>
        <!-- 数据图 end -->
        <div class="box">
                <div class="box-header">
                  <h3 class="box-title">交易商结算查询明细<c:if test="${oldDate ne null }">（${oldDate}）</c:if></h3>
                  <div class="box-tools pull-right">
                <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                <!-- <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-remove"></i></button> -->
              </div>
                </div><!-- /.box-header -->
                <div class="box-tools pull-right" style="padding-right:10px">单位:万元</div>
                <div class="box-body">
                  <table id="dataTab" class="table table-bordered table-hover dataTable no-footer">
                  	<thead>
                  		<tr>
                  		<th>买受人结算单位</th>
                  		<th>买受人结算单位所属地区</th>
                  		<th>买受人结算单位所属行业</th>
                  		<th>出卖人结算单位</th>
                  		<th>出卖人结算单位所属地区</th>
                  		<th>出卖人结算单位所属行业</th>
                  		<th>现金笔数</th>
                  		<th>现金金额</th>
                  		<th>现金占比</th>
                  		<th>承兑汇票笔数</th>
                  		<th>承兑汇票金额</th>
                  		<th>承兑汇票占比</th>
                  		<th>合计金额</th>
                  		</tr>
                  	</thead>
	                <tbody>
	                	<c:forEach items="${resList}" var="li">
	                		<tr>
	                			<td>${li.odwname}</td>
	                			<td>${li.oshenf}</td>
	                			<td>${li.ohany}</td>
	                			<td>${li.idwname}</td>
	                			<td>${li.ishenf}</td>
	                			<td>${li.ihany}</td>
	                			<td>${li.xjbs}</td>
	                			<td>${li.xj}</td>
	                			<td>${li.xjzb}%</td>
	                			<td>${li.cdbs}</td>
	                			<td>${li.cde}</td>
	                			<td>${li.cdzb}%</td>
	                			<td>${li.hj}</td>
	                		</tr>
	                	</c:forEach>
	                </tbody>
                  </table>
                </div><!-- /.box-body -->
              </div><!-- /.box -->
          

        </div><!-- /.content -->
      </div><!-- /.content-wrapper -->
</div> 
<script type="text/javascript">

</script> 
</body>
</html>
